<?php
 if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Ruta extends CI_Controller {
	
	private $oRuta;
	
	function __construct(){
		parent::__construct();
		$this->load->library('valida_sesion');
		$this->load->model('customer_model','CustomerModel');
		$this->load->helper(array('form', 'url'));
        //$this->load->model('nota_venta_model','notaVentaModel');
		$this->load->library('form_validation');
		$this->oRuta = new Ruta_model();
		
	}
	
	
	/*
	
	Array
	(
			[vis_id_visita] => 115
			[esv_id_estadovisita] => 1
			[mov_id_movil] => 2
			[per_id_persona] => 1
			[ser_id_servicio] => 408
			[vis_fechavisita] => 2013-04-29
			[vis_horavisita] => 00:00:00
			[not_id_notaventa] => 280
			[tse_id_tiposervicio] => 1
			[tse_descripcion] => Desratizacion
			[desc_corta] => DR,CF,DT
			[cli_id_cliente] => 4
			[cli_nombrecliente] => Combustibles Suarez
			[cli_comunacliente] => Puerto saavedra
			[cli_fonocliente] => 61743842222
			[cli_direccioncliente] => Juvencio ovalle 20456
	)
	
	*/

	public function rutasServicios(){
		
		$oListaServicios = $this->oRuta->obtenerVisitas();
		
		$oTablaRuta = '';
		foreach($oListaServicios as $oServicio){
				
			$oTablaRuta['oTablaRuta'] .= "<tr class=\"odd\">
							<td class=\"  sorting_1\"><input type=\"text\" name=\"horaVisita[]\" class=\"span2 horaVisita input-horavisita\" maxlength=\"5\" autocomplete=\"off\"></td>
							<td class=\"cli_nombrecliente \">".$oServicio['cli_nombrecliente']."</td>
							<td class=\"cli_comunacliente \">".$oServicio['cli_comunacliente']."</td>
							<td class=\"cli_fonocliente \">".$oServicio['cli_fonocliente']."</td>
							<td class=\"cli_direccioncliente \">".$oServicio['cli_direccioncliente']."</td>
							<td class=\"desc_corta \">".$oServicio['desc_corta']."</td>
		
							<td class=\"cantidad_visitas \">".$oServicio['cantidad_visitas']."</td>
							<td class=\"td-center rc-tn-route-img rc-tn-route-img  \"><a href=\"#\" class=\" editar\"><img src=\"http://localhost/ratacom/assets/imagenes/editar.png\" class=\"rc-table-route\"></a></td>
							<td class=\"td-center rc-tn-route-img \"><a href=\"#\" class=\" editar2\"><img src=\"http://localhost/ratacom/assets/imagenes/editar.png\" class=\"rc-table-route\"></a></td>
							<td class=\"td-center rc-tn-route-img \"><a href=\"#\" class=\" imprimir\"><img src=\"http://localhost/ratacom/assets/imagenes/imprimir.png\" class=\"rc-table-route\"></a></td>
							<td class=\"td-center rc-tn-route-img \"><a href=\"#\" class=\" imprimir2\"><img src=\"http://localhost/ratacom/assets/imagenes/imprimir.png\" class=\"rc-table-route\"></a></td>
							<td class=\"td-center rc-tn-route-img \"><a href=\"#\" class=\" verificacion\"><img src=\"http://localhost/ratacom/assets/imagenes/verificacion.png\" class=\"rc-table-route\"></a></td>
						</tr>";
				
		}
		//print_r($oTablaRuta);exit();
		
		$this->load->view('admin/rutaView',$oTablaRuta);
		
		
		//print_r('bien culiao');
		
	}
	

	
	
	
	
}